package com.timoon.testng.service;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.timoon.app.resource.image.ImageLocation;
import com.timoon.sample.dao.RoleDAOImpl;

public class ServiceTest {

	private static BeanFactory factory;
	
	//@BeforeClass
	public static void initFactory(){
		factory=new ClassPathXmlApplicationContext("applicationContext.xml");
	}
	
	@Test
	public void roleService(){
		StringBuffer path=new StringBuffer(ImageLocation.class.getClassLoader().getResource("com/timoon/app/resource/image/product/").toString());
		StringBuffer picName=new StringBuffer("abc.jpg");
		
		System.err.println(path);
		
		
		//截取储存路径
//		String starting=path.substring(0,path.lastIndexOf("/")+1);
//		
//		//截取客户端图片后缀
//		String ending=picName.substring(picName.lastIndexOf("."));
//		
//		//获取系统时间
//		String newName=starting+String.valueOf((new Date()).getTime())+ending;
//		
//		System.err.println(newName);
		
	}
	
	
}
